
#include <sys/neutrino.h>

#include "Timer.h"
#include "HAWThread.h"

#ifndef MYRECV_H_
#define MYRECV_H_

/**
 * \brief Class for Timeraccess
 * This class Wraps the Timer.
 */
class MyRecv: public thread::HAWThread {
private:

	void execute(void*);

	int chid;
	int value;
	int value_sec;
	int value_nsec;
	int timerID;
	int timerChanneID;
	bool running;
	Timer * timer;

public:

    /**
     * \brief Constructor to construct new MyRecv with given values
     * \param chid the channel on which the timer will send a pulse one run out
     * \param value value of pulse message
     * \param value_sec the number of seconds with which the timer will be initialized
     * \param value_nsec the number of nanoseconds with which the timer will be initialized
     */
	MyRecv( int chid, int value, int value_sec, int value_nsec );

    /**
     * \brief gets the Timer Instance, wrapped by this class
     */
	Timer* getInstance();

    /**
     * \brief starts Timer
     */
	void startTimer();

    /**
     * \brief stops Thread
     */
	void shutdown();

    /**
     * \brief Destructor
     */
	virtual ~MyRecv();
};
#endif
